package com.example.zy.car.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.example.zy.car.R;
import com.example.zy.car.base.BaseActivityWithTitleBar;
import com.example.zy.car.view.NewEvaluateActivity;

public class MainActivity extends BaseActivityWithTitleBar implements View.OnClickListener {
    private TextView mTv_newpg,mTv_unfinishpg,mTv_finishpg,mTv_searchcar,mTv_searchstock,mTv_account;
    

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        this.setCenterTitleTv("网利二手车");
        initView();
        initData();
    }

    private void initData() {
        mTv_newpg.setOnClickListener(this);
        mTv_unfinishpg.setOnClickListener(this);
        mTv_finishpg.setOnClickListener(this);
        mTv_searchcar.setOnClickListener(this);
        mTv_searchstock.setOnClickListener(this);
        mTv_account.setOnClickListener(this);
    }

    private void initView() {
        mTv_newpg= (TextView) findViewById(R.id.tv_function_menu_newpg);
        mTv_unfinishpg= (TextView) findViewById(R.id.tv_function_menu_unfinnshpg);
        mTv_finishpg= (TextView) findViewById(R.id.tv_function_menu_finnshpg);
        mTv_searchcar= (TextView) findViewById(R.id.tv_function_menu_search_car);
        mTv_searchstock= (TextView) findViewById(R.id.tv_function_menu_search_stock);
        mTv_account= (TextView) findViewById(R.id.tv_function_menu_account);
    }

    @Override
    public void onClick(View v) {
        switch(v.getId()){
            case R.id.tv_function_menu_newpg:
                MyTransalteActivity(NewEvaluateActivity.class);
                break;
            case R.id.tv_function_menu_unfinnshpg:
                MyTransalteActivity(UnfinishEvaluateActivity.class);
                break;
            case R.id.tv_function_menu_finnshpg:
                MyTransalteActivity(FinishEvaluateActivity.class);
                break;
            case R.id.tv_function_menu_account:
                MyTransalteActivity(AccountActivity.class);
                break;
            default:
                break;
        }
    }
//    @Override
//    public boolean onBackPressed() {
//
//        if (((MainActivity)mActivity).checkCanOut()){
//            mActivity.finish();
//        }
//        return true;
//    }
   
}
